package Windows;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.ScrollPane;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;

//import com.sun.codemodel.internal.JLabel;

public class ServerWindow extends JFrame {
	private JLabel label, label2, label3;
	private JTextArea textArea, textArea2;
	private JPanel panel, panel2, panel3;


	public ServerWindow() {
		setTitle("服务器端");
		setSize(900, 500);
		setResizable(false);// 窗口大小不能改变
		setLocationRelativeTo(null);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		getContentPane().setLayout(new BorderLayout());
		// getContentPane().setBackground(Color.pink);

		label = new JLabel("服务器端");
		// label.setSize(300, 100);
		// label.setBounds(400, 0, 500, 100);
		panel = new JPanel();
		panel.add(label);
		add(panel, "North");

		panel2 = new JPanel();
		panel2.setLayout(new BorderLayout());
		panel2.setBackground(Color.green);
		label2 = new JLabel("在线列表");
		// label2.setBounds(10, 50, 500, 100);
		panel2.add(label2, "North");

		ScrollPane p2;
		p2 = new ScrollPane();
		p2.setSize(300, 200);
		panel2.add(p2, "Center");
		textArea = new JTextArea(" ", 23, 33);
		p2.add(textArea);
		// textArea.setSize(200, 300);

		// panel2.add(p2,"South");

		add(panel2, "West");

		panel3 = new JPanel();
		panel3.setLayout(new BorderLayout());
		panel3.setBackground(Color.pink);
		label3 = new JLabel("聊天记录");
		// label3.setBounds(40, 50, 10, 100);;
		panel3.add(label3, "North");

		ScrollPane p1;
		p1 = new ScrollPane();
		p1.setSize(300, 200);
		panel3.add(p1, "Center");
		textArea2 = new JTextArea(" ", 23, 33);

		// panel3.add(textArea2,"South");
		p1.add(textArea2);

		add(panel3, "East");
		setVisible(true);
	}


	public JTextArea getTextArea() {
		return textArea;
	}


	public void setTextArea(JTextArea textArea) {
		this.textArea = textArea;
	}


	public JTextArea getTextArea2() {
		return textArea2;
	}


	public void setTextArea2(JTextArea textArea2) {
		this.textArea2 = textArea2;
	}

}
